<%--
  User: Integra
  Date: 03.03.2009
  Time: 2:37:22
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<html>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<f:view locale="#{localeManager.locale}">
    <f:loadBundle var="msgs" basename="messages"/>
    <head>
        <title><h:outputText value="#{msgs['title']}"/></title>
        <link href="olga.css" rel="stylesheet" type="text/css">
    </head>
    <body>
        <h:form id="formregisterTeam">
            <%@include file="logoPanel.jspf"%>
            <%@include file="navigationPanel.jspf"%>
            <h1>Registration</h1>
            <h:panelGrid columns="3">
            <h3><h:outputText value="Login "/>
            <h:panelGroup>
                <h:inputText id="login" validator="#{registerTeam.loginValidator}" required="true">
                    <f:attribute name="requiredMessage" value="#{msgs.emptyField}"></f:attribute>
                </h:inputText>
                <h:message for="login"></h:message>
            </h:panelGroup>
            </h3>
            <h3><h:outputText value="Password "/>
            <h:panelGroup>
                <h:inputSecret id="password" validatorMessage="#{msgs.minLengthOfPassword}" required="true">
                    <f:validateLength minimum="5"></f:validateLength>
                    <f:attribute name="requiredMessage" value="#{msgs.emptyField}"></f:attribute>
                </h:inputSecret>
                <h:message for="password"></h:message>
            </h:panelGroup>
            </h3>
            <h3><h:outputText value="Confirm password "/>
            <h:panelGroup>
                <h:inputSecret id="confirmpassword" required="true"  validator="#{registerTeam.passValidator}">
                     <f:attribute name="requiredMessage" value="#{msgs.emptyField}"></f:attribute>
                </h:inputSecret>
                <h:message for="confirmpassword"></h:message>
            </h:panelGroup>
             </h3>
            <h3><h:outputText value="Team name "/>
            <h:panelGroup>
                <h:inputText id="teamname" required="true" >
                    <f:attribute name="requiredMessage" value="#{msgs.emptyField}"></f:attribute>
                </h:inputText>
                  <h:message for="teamname"></h:message>
            </h:panelGroup>
            </h3>
            </h:panelGrid>
            <h3><h:outputText value="Members "/> </h3>
            <h:panelGrid columns="2">
            <h:outputText value="Member one"></h:outputText>
                <h:selectOneMenu id="member_1" value="#{registerTeam.selectedPerson1}"><f:selectItems value="#{registerTeam.selectPerson}"></f:selectItems> </h:selectOneMenu>
            <h:outputText value="Member two"></h:outputText>
                <h:selectOneMenu id="member_2" value="#{registerTeam.selectedPerson2}"><f:selectItems value="#{registerTeam.selectPerson}"></f:selectItems> </h:selectOneMenu>
            <h:outputText value="Member three"></h:outputText>
                <h:selectOneMenu id="member_3" value="#{registerTeam.selectedPerson3}"><f:selectItems value="#{registerTeam.selectPerson}"></f:selectItems> </h:selectOneMenu>
            </h:panelGrid>
            <h:panelGrid columns="2">
             <h:commandButton value="Register" action="#{registerTeam.addTeamToDB}"/>
             <h:commandButton value="Cancel" action="login" immediate="true"></h:commandButton>
            </h:panelGrid>
        </h:form>
    </body>
</f:view>
</html>